package freshmanspecial.mredrock.com.welcomefreshman.Fragment;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;

import freshmanspecial.mredrock.com.welcomefreshman.Adapter.GoodPeopleAdapter;
import freshmanspecial.mredrock.com.welcomefreshman.Base.BaseFragment;
import freshmanspecial.mredrock.com.welcomefreshman.Model.MienModel;
import freshmanspecial.mredrock.com.welcomefreshman.R;

/**
 * Created by Administrator on 2017/8/6 0006.
 */

public class MienTeaFragment extends BaseFragment {
    private GoodPeopleAdapter adapter;
    private RecyclerView recyclerView;
    @Override
    protected void addDefaultData() {

    }

    protected void addData() {

    }

    @Override
    protected void initView() {
        recyclerView = $(R.id.mien_teacher);
        recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2,StaggeredGridLayoutManager.VERTICAL));
        MienModel mienModel = new MienModel();
        mienModel.getTeacher(new MienModel.OnGetMien() {
            @Override
            public void onFinish(Object dataBean) {
                recyclerView.setAdapter(adapter = new GoodPeopleAdapter(dataBean,getContext(),2));
            }
        });
    }

    @Override
    protected int getResourceId() {
        return R.layout.special_2017_mien_teacher_fragment;
    }
}
